﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgNetComponentsDx.Options.Design
{
    public class OptionTypeEditor : ProgNetComponents.Design.Editors.BaseListEditor
    {
        protected override bool AlwaysRefreshItems
        {
            get
            {
                return false;
            }
        }

        protected override bool FillCollection(ProgNetComponents.Collections.NamedObjectCollection collection, System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            collection.Clear();
            collection.Add(new ProgNetComponents.Classes.NamedObject("<NULL>", null));
            collection.Add(new ProgNetComponents.Classes.NamedObject("String", typeof(string)));
            collection.Add(new ProgNetComponents.Classes.NamedObject("Int32", typeof(Int32)));
            collection.Add(new ProgNetComponents.Classes.NamedObject("Decimal", typeof(decimal)));
            collection.Add(new ProgNetComponents.Classes.NamedObject("Boolean", typeof(bool)));
            collection.Add(new ProgNetComponents.Classes.NamedObject("DateTime", typeof(DateTime)));
            return true;
        }
    }
}
